package com.yurun.storageservice.tcc;

import com.yurun.domain.OrderTb;
import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

/**
 * @author Xi Gao
 * @date 2020/9/13 13:52
 */
@LocalTCC
public interface StorageActionService {

    @TwoPhaseBusinessAction(name = "reduceStock", commitMethod = "mycommit", rollbackMethod = "myrollBack")
    boolean reduceStock(BusinessActionContext context,
                        @BusinessActionContextParameter(paramName = "goodCode") String goodCode,
                        @BusinessActionContextParameter(paramName = "num") Integer num);

    boolean mycommit(BusinessActionContext context);

    boolean myrollBack(BusinessActionContext context);


}
